import axios from 'axios'

export default {
  async getStores (barCode) {
    let result = await axios({
      url: '/api/shopowner/getStores/' + barCode,
      method: 'get',
      data: {
        barCode: barCode
      }
    })
    return result
  },

  async getStocks (commodity) {
    let result = await axios({
      url: '/api/shopowner/getStocks/' + commodity,
      method: 'get',
      data: {
        commodity: commodity
      }
    })
    return result
  },

  async commitShelfAddedApply (data) {
    let result = await axios({
      url: '/api/shopowner/commitShelfAddedApply',
      method: 'post',
      data: data
    })
    return result
  },

  async searchGoodsByStoreIdAndCommodity (storeId, commodity) {
    let result = await axios({
      url: '/api/shopowner/searchGoodsByStoreIdAndCommodity?storeId=' + storeId + '&commodity=' + commodity,
      method: 'get'
    })
    return result
  },

  async shelfDownGoods (storeId, barCode) {
    let result = await axios({
      url: '/api/shopowner/shelfDownGoods',
      method: 'post',
      data: {
        barCode: barCode,
        storeId: storeId
      }
    })
    return result
  }
}
